/* 全局样式重置 */
* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

.patient {
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f5f5f5;
  overflow-x: hidden;
  position: relative;
}

/* 详情页容器 */
.patientDetail-container {
  flex: 1;
  background: #ffffff;
  margin: 10px;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  width: calc(100% - 20px);
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
}

/* 标题区域 */
.patientDetail-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.patientDetail-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  margin-bottom: 8px;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.patientDetail-time {
  font-size: 12px;
  color: #999;
}

/* 用户信息 */
.patientDetail-user {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.patientDetail-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e6f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.avatar-placeholder {
  font-size: 24px;
  color: #1890ff;
}

.patientDetail-user-info {
  flex: 1;
}

.patientDetail-username {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.patientDetail-disease,
.patientDetail-department {
  font-size: 14px;
  color: #666;
  margin-bottom: 3px;
}

/* 章节样式 */
.patientDetail-section {
  margin-bottom: 20px;
}

.patientDetail-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid #1890ff;
}

.patientDetail-content {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* 治疗经历 */
.patientDetail-treatment {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
}

.treatment-hospital,
.treatment-time {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.treatment-process {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* 相关图片 */
.patientDetail-images {
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.patientDetail-images img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 统计信息 */
.patientDetail-stats {
  display: flex;
  text-align: right;
  gap: 20px;
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.stat-item {
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.stat-item:hover {
  background-color: #e6f7ff;
}

.stat-icon {
  font-size: 16px;
}

.stat-text {
  font-size: 14px;
  font-weight: 500;
}

/* 被采纳的建议 */
.patientDetail-adopt {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.adopt-suggestion {
  margin-top: 10px;
}

.adopt-user {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.adopt-avatar {
  margin-right: 10px;
}

.adopt-user-info {
  flex: 1;
}

.adopt-username {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 3px;
}

.adopt-reward {
  font-size: 12px;
  color: #ff6b35;
  margin-bottom: 3px;
}

.adopt-time {
  font-size: 12px;
  color: #999;
}

.adopt-content {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  background: #ffffff;
  padding: 10px;
  border-radius: 4px;
  border-left: 3px solid #1890ff;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* 加载和错误状态 */
.loading,
.error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 16px;
  color: #666;
}

.error {
  color: #ff4d4f;
}

.patient .patient-header,
.patient .patient-footer {
  width: 100%;
  height: 56px;
  display: flex;
  justify-content: space-between;
}

.patient .patient-header div,
.patient .patient-footer div {
  text-align: center;
  align-items: center;
}

.patient .patient-main {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  background: #f9f9f9;
}

/* 底部导航 */
.patient .patient-footer {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid #eee;
  align-items: center;
  padding: 0 24px;
  z-index: 10;
}

.patient .patient-footer .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #666;
  font-size: 12px;
}

.patient .patient-footer .tab .tab-icon {
  width: 25px;
  font-size: 20px;
  line-height: 22px;
}

.patient .patient-footer .tab .tab-label {
  margin-top: 4px;
}

.patient .patient-footer .center-btn {
  position: relative;
  width: 64px;
  height: 64px;
  margin-top: -24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4bb0ff, #2d8cf0);
  box-shadow: 0 6px 18px rgba(45, 140, 240, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.patient .patient-footer .center-btn .center-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #2d8cf0;
}

.patient-main-swiper {
  width: 100%;
  /* height: 100px; */
}

.patient-main-title {
  width: 100%;
  height: 100px;
  border-top: 1px solid #cccccc;
  border-bottom: 1px solid #cccccc;
  margin: 5px 0;
  padding: 10px 0;
  background: #fff;
}

.patient-department-scroll {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  padding: 0 15px;
  height: 100%;
  align-items: center;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.patient-department-scroll::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari and Opera */
}

.patient-department-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f5f5f5;
  transition: all 0.3s ease;
  cursor: pointer;
}

.patient-department-item.active {
  background: #1890ff;
  color: #fff;
  transform: scale(1.05);
}

.patient-department-item:hover {
  background: #e6f7ff;
  transform: scale(1.02);
}

.patient-department-item.active:hover {
  background: #40a9ff;
}

.patient-department-icon {
  margin-bottom: 4px;
}

.patient-department-name {
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* 病友圈卡片样式 */
.patient-main-patient {
  flex: 1;
  background: #f5f5f5;
  padding: 10px 15px;
  overflow-y: auto;
}

.patient-card {
  background: #ffffff;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.patient-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.patient-card-header {
  /* display: flex;
  justify-content: space-between; */
  align-items: flex-start;
  margin-bottom: 10px;
}

.patient-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  flex: 1;
  margin-right: 10px;
}

.patient-card-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.patient-card-date {
  font-size: 12px;
  color: #999;
  margin-bottom: 2px;
}

.patient-card-time-text {
  font-size: 12px;
  color: #999;
}

.patient-card-content {
  position: relative;
  margin-bottom: 12px;
}

.patient-card-author {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.patient-card-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b35;
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 30px;
  text-align: center;
}

.patient-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.patient-card-stats {
  gap: 15px;
  text-align: right;
}

.patient-card-stats>span {
  margin: 0 10px;
}

.patient-card-collect,
.patient-card-suggest {
  font-size: 12px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
}

.patient-card-collect:hover,
.patient-card-suggest:hover {
  color: #1890ff;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .patientDetail-container {
    margin: 5px;
    padding: 15px;
    width: calc(100% - 10px);
    max-width: calc(100vw - 10px);
  }

  .patient-main-patient {
    padding: 8px 12px;
  }

  .patient-card {
    padding: 12px;
    margin-bottom: 10px;
  }

  .patient-card-title {
    font-size: 15px;
  }

  .patient-card-author {
    font-size: 13px;
  }

  .patient-card-stats {
    gap: 12px;
  }

  .patientDetail-title {
    font-size: 16px;
  }

  .patientDetail-content,
  .treatment-process,
  .adopt-content {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .patientDetail-container {
    margin: 3px;
    padding: 12px;
    width: calc(100% - 6px);
    max-width: calc(100vw - 6px);
  }

  .patientDetail-title {
    font-size: 15px;
  }

  .patientDetail-content,
  .treatment-process,
  .adopt-content {
    font-size: 12px;
  }
}

/* 遮罩层样式 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.overlay-content {
  background: #ffffff;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 15px 20px;
  background: #ffffff;
}

.overlay-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background-color: #f5f5f5;
  color: #666;
}

.overlay-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0;
}

/* 用户列表样式 */
.user-list {
  padding: 0;
}

.user-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  transition: background-color 0.2s ease;
}

.user-item:hover {
  background-color: #f8f9fa;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e6f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 18px;
  color: #1890ff;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.user-time {
  font-size: 12px;
  color: #999;
}

/* 评论列表样式 */
.comment-list {
  padding: 0;
}

.comment-item {
  display: flex;
  padding: 15px 20px;
  transition: background-color 0.2s ease;
}

.comment-item:hover {
  background-color: #f8f9fa;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e6f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 18px;
  color: #1890ff;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.comment-time {
  font-size: 12px;
  color: #999;
}

.comment-text {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 10px;
  word-wrap: break-word;
  word-break: break-word;
}

.comment-actions {
  display: flex;
  gap: 15px;
}

.comment-like,
.comment-dislike {
  font-size: 12px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.comment-like:hover,
.comment-dislike:hover {
  background-color: #f0f0f0;
  color: #666;
}

/* 评论输入栏样式 */
.comment-input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2c2c2c;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1001;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.comment-close-btn {
  background: #2c2c2c;
  border: none;
  color: #ffffff;
  font-size: 20px;
  font-weight: bold;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.comment-close-btn:hover {
  background: #404040;
}

.comment-close-btn:active {
  background: #555555;
  transform: scale(0.95);
}

.comment-input-wrapper {
  flex: 1;
  background: #f5f5f5;
  border-radius: 20px;
  padding: 0 16px;
  height: 40px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.comment-input-wrapper:hover {
  background: #e8e8e8;
}

.comment-input-wrapper:focus-within {
  background: #ffffff;
  box-shadow: 0 0 0 2px #1890ff;
}

.comment-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #333;
  height: 100%;
  cursor: text;
}

.comment-input:focus {
  outline: none;
}

.comment-input::placeholder {
  color: #999;
  font-size: 14px;
}

.comment-submit-btn {
  width: 100px;
  background: #1890ff;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 60px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-submit-btn:hover {
  background: #40a9ff;
  transform: translateY(-1px);
}

.comment-submit-btn:active {
  background: #096dd9;
  transform: translateY(0) scale(0.98);
}

.comment-submit-btn:disabled {
  background: #d9d9d9;
  color: #999;
  cursor: not-allowed;
  transform: none;
}

.comment-submit-btn:disabled:not(.submitting) {
  background: #d9d9d9;
  color: #999;
}

.comment-submit-btn.submitting {
  background: #40a9ff;
  color: #ffffff;
  cursor: not-allowed;
}

/* 评论列表相关样式 */
.loading-comments,
.no-comments,
.no-data {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.load-more-comments {
  padding: 15px 20px;
  text-align: center;
  border-top: 1px solid #f0f0f0;
}

.load-more-btn {
  background: #f5f5f5;
  border: 1px solid #d9d9d9;
  color: #666;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.load-more-btn:hover:not(:disabled) {
  background: #e6f7ff;
  border-color: #91d5ff;
  color: #1890ff;
}

.load-more-btn:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .overlay {
    padding: 10px;
  }

  .overlay-content {
    max-width: 100%;
    max-height: 85vh;
  }

  .overlay-header {
    padding: 15px 15px 10px 15px;
  }

  .overlay-title {
    font-size: 16px;
  }

  .user-item,
  .comment-item {
    padding: 12px 15px;
  }

  .user-avatar,
  .comment-avatar {
    width: 35px;
    height: 35px;
    font-size: 16px;
    margin-right: 10px;
  }

  .user-name {
    font-size: 15px;
  }

  .comment-text {
    font-size: 13px;
  }

  .comment-input-bar {
    padding: 10px 12px;
    gap: 10px;
  }

  .comment-close-btn {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .comment-input-wrapper {
    height: 36px;
    padding: 0 12px;
  }

  .comment-input {
    font-size: 13px;
  }

  .comment-input::placeholder {
    font-size: 13px;
  }

  .comment-submit-btn {
    padding: 6px 12px;
    font-size: 13px;
    height: 36px;
    min-width: 50px;
  }
}